package com.zxy.dept.controller;

import com.zxy.base.dto.Result;
import com.zxy.base.util.ResultUtil;
import com.zxy.dept.dto.DeptTreeNode;
import com.zxy.dept.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private DeptService deptService;

    @GetMapping("/getDeptNodeTree")
    public Result getDeptNodeTree() {
        List<DeptTreeNode> deptTreeNodeList = deptService.getDeptTreeNodeList();

        return ResultUtil.success(deptTreeNodeList);
    }

}
